{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "# Standard Deviation and Variance"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false,
    "deletable": true,
    "editable": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAD8CAYAAACW/ATfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAEQ5JREFUeJzt3V2MXGd9x/HvDxMCAlriZmsZ29RGcls5EiRolbaCINIU\nEqCq05vIlVpZlSXfuBSkVsUuF+XGkqnUqJXaILlA65YX1+JFtgCBHJcIVaowGzBJbOPGkES25Zfl\nTUAvTOP+ezHHdOJ4vbO7M56xn+9HWs1znnOO5++zs7999sw5z6SqkCTd3F4y7gIkSaNn2EtSAwx7\nSWqAYS9JDTDsJakBhr0kNcCwl6QGGPaS1ADDXpIa8NJxFwBw++2319q1a8ddhiTdUB5//PHvVdXU\nINtORNivXbuWmZmZcZchSTeUJM8Nuq2ncSSpAYa9JDXAsJekBgwU9klek+TTSb6d5HiS30qyPMnB\nJE93j7f1bb8jyckkJ5LcP7ryJUmDGHRk/3fAl6rq14E3AseB7cChqloPHOqWSbIB2ATcATwAPJJk\n2bALlyQNbt6wT/KLwFuBjwJU1c+q6kfARmBPt9ke4MGuvRHYW1UXq+oZ4CRw97ALlyQNbpCR/Tpg\nFvinJN9M8pEkrwRWVNXZbptzwIquvQo41bf/6a5PkjQmg4T9S4E3AR+uqruA/6Y7ZXNZ9T7bcEGf\nb5hka5KZJDOzs7ML2VWStECDhP1p4HRVfa1b/jS98D+fZCVA93ihW38GWNO3/+qu7wWqandVTVfV\n9NTUQDeASZIWad47aKvqXJJTSX6tqk4A9wHHuq/NwK7ucX+3ywHgk0keBl4LrAcOj6J4aZjWbv/C\nVfuf3fXu61yJNHyDTpfwHuATSV4GfBf4Y3p/FexLsgV4DngIoKqOJtl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gZXAm7r2q4H/6uqZqGN6jTon6pgCAV7VtW8BvgbcM8zj6ch+fhuBvVV1saqeAU7Smw5i\nXH4+FUVV/Qy4PBXFJNsI7Onae4AHr3cBVfVV4AdXdM9V19i+53PUOZdx1nm2qr7RtX8CHKd35/xE\nHdNr1DmXcdVZVfXTbvEWeoO6HzLE42nYv9B7kjzR/Sl9+c+lq039cK0Xy6hNWj1XKuDRJI93d0kD\nrKiqs137HLBiPKW9yFx1TeIxntjXZpK1wF30RqMTe0yvqBMm7JgmWZbkCHABeKyqnmKIx7OpsE/y\naJKnrvK1EfgwvVMjdwJngb8Za7E3rrdU1Z3AO4FtSd7av7J6f4NO3CVgk1pXZ2Jfm0leBXwGeF9V\n/bh/3SQd06vUOXHHtKoudT87q4F7ktx7xfolHc+mPrykqn5nkO2S/CPw+W5x3qkfrrNJq+cFqupM\n93ghyefo/Wl5PsnKqjqbZCW9kcskmKuuiTrGVXX+cnuSXptJbqEXoJ+oqs923RN3TK9W56QeU4Cq\n+lGSLwDTDPF4NjWyv5buQF72+8DlqyEOAJuS3JpkHbAeOHy96+szsVNRJHllkldfbgPvoHccDwCb\nu802A/vHU+GLzFXXRH3PJ/G1mSTAR4HjVfVw36qJOqZz1TlpxzTJVJLXdO1X0PsskCMM83iO+l3m\nG+UL+FfgSeCJ7kCu7Fv3AXrvdp8A3jkBtb6L3lUF3wE+MO56+up6Pb0rBL4FHL1cG/BLwCHgaeBR\nYPkYavsUvT/X/4fe+c0t16prXN/zOeqcuNcm8BZ6pxSe6ELpSPe6nKhjeo06J+qYAm8Avtn97DwJ\nvL/rH9rx9A5aSWqAp3EkqQGGvSQ1wLCXpAYY9pLUAMNekhpg2EtSAwx7SWqAYS9JDfg/D0Q13OtR\n0sAAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1e529b17358>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "incomes = np.random.normal(100.0, 50.0, 10000)\n",
    "\n",
    "plt.hist(incomes, 50)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false,
    "deletable": true,
    "editable": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "49.77851466593912"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "incomes.std()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false,
    "deletable": true,
    "editable": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2477.9005223471163"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "incomes.var()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "## Activity"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "deletable": true,
    "editable": true
   },
   "source": [
    "Experiment with different parameters on the normal function, and see what effect it has on the shape of the distribution. How does that new shape relate to the standard deviation and variance?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false,
    "deletable": true,
    "editable": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
